package com.android.infantschool.util;

import android.net.Uri;
import android.nfc.Tag;
import android.os.Build;
import android.os.Environment;
import android.support.v4.content.FileProvider;
import android.util.Log;

import com.android.infantschool.app.InfantApp;

import java.io.File;

/**
 * @author Administrator
 * @particulars
 * @time 2019\7\5 0005 15:38
 * @class describe
 */
public class Constant {

    /**
     * app缓存地址
     */
    public static String PROJECT_PATH = Environment.getExternalStorageDirectory().getAbsolutePath()
            + File.separator + "InfantSchool";

    /**
     * 下载App存放位置
     */
    public static String getFileApp() {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            Log.e("TAG", "Android 7.0+");
            return InfantApp.context.getFilesDir().getAbsolutePath()
                    + File.separator + "/Download/infant.apk";
        } else {
            Log.e("TAG", "Android 6.0");
            return InfantApp.context.getExternalCacheDir().getAbsolutePath()
                    + File.separator + "/Download/infant.apk";
        }
    }

    /**
     * 录制视频存放位置
     */
    public static String VIDEO_PATH() {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            Log.e("TAG", "Android 7.0+");
            return InfantApp.context.getFilesDir().getAbsolutePath()
                    + File.separator + "/DCIM/Video";
        } else {
            Log.e("TAG", "Android 6.0");
            return InfantApp.context.getExternalCacheDir().getAbsolutePath()
                    + File.separator + "/DCIM/Video";
        }
    }

    /**
     * 录制视频存放位置
     */
    public static String IMAGE_PATH() {
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            Log.e("TAG", "Android 7.0+");
            return InfantApp.context.getFilesDir().getAbsolutePath()
                    + File.separator + "/DCIM/Camera";
        } else {
            Log.e("TAG", "Android 6.0");
            return InfantApp.context.getExternalCacheDir().getAbsolutePath()
                    + File.separator + "/DCIM/Camera";
        }
    }
}
